﻿using System;
using System.ComponentModel.DataAnnotations;

namespace AikeShoop.ViewModels
{
    public class UserLoginViewModel
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        [Display(Name = "用户名")]
        public string username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        [Display(Name = "密码")]
        [DataType(DataType.Password)]
        [RegularExpression(@"^(?:(\d|[a-zA-Z]|[_!@#$%^&*])*)$", ErrorMessage = "密码只能使用数字字母或特殊字符组成")]
        public string password { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        [Display(Name = "图形验证码")]
        [Required(ErrorMessage = "图形验证码不能为空")]
        [RegularExpression(@"^[0-9]*$", ErrorMessage = "只能输入数字")]
        public string verificationcode { get; set; }
    }
}
